package reflect;

import java.lang.reflect.Method;

/**
 * 通过反射机制获取Method对应方法的信息
 */
public class ReflectDemo5 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("say", String.class,int.class);

        String name = method.getName();
        System.out.println("方法名："+name);


    }
}
